package com.zc.study.thread.多线程第三章节.thread3_1_11;

public class C {
    private String lock;

    public C(String lock) {
        this.lock = lock;
    }
    public void getValue(){
        synchronized (lock){
            while(ValueObject.value.equals("")){
                System.out.println("消费者"+Thread.currentThread().getName()+"WAITING");
                try {
                    lock.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }
            System.out.println("消费者"+Thread.currentThread().getName()+"RUNNABLE");
            ValueObject.value="";
            lock.notify();

        }
    }
}
